home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
comms
/
html-heaven
/
arexx
/
html-memacs.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-01-08
|
1KB
|
38 lines
/* HTML-Helper Arexx script for GNU Emacs
* Ver : 1.1 (7th January 1996)
* Author : Ellis Pritchard (efp90@nuke.dircon.co.uk)
* Function : Pass on the HTML commands from HTML-Helper to Emacs.
* Input : HTMLCMD - The HTML command to be inserted.
*/
OPTIONS RESULTS /* enable return codes */
PARSE ARG MYCMD HTMLCMD
HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space */
HTMLCMDNOQUOTES = ''
/* Delete internal quotes */
DO i=1 TO LENGTH(HTMLCMD)
CH = SUBSTR(HTMLCMD,i,1)
IF CH ~= '"'
THEN
HTMLCMDNOQUOTES = HTMLCMDNOQUOTES || CH
END
HTMLCMD = HTMLCMDNOQUOTES /* saves me some rewriting */
ADDRESS 'EMACS1' /* Default, edit if needed */
IF POS('><',HTMLCMD) ~= 0 THEN DO /* Is it a split command? */
/* If yes, then.... */
CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
'(save-excursion (kill-region (mark) (point)) (insert-string "'||CMD1||'" ) (yank) (insert-string "'||CMD2||'"))'
END
ELSE
'(insert-string "'||HTMLCMDNOQUOTES||'")' /* Insert at current pos */
EXIT /* And exit the script. */